package com.base.method;

/**
 * 方法重载
 */
public class Demo01 {
    public static void main(String[] args) {
        Demo01 demo01 = new Demo01();
        System.out.println(demo01.add(1,2));
        System.out.println(demo01.add(1.4,3.5));
    }

    public int add(int a, int b){
        return a+b;
    }
     //方法名称相同，形参类型不同
    public double add(double a,double b){
        return a+b;
    }
}
